<script setup>
const props = defineProps({
  money: Number,
  car: String,
  ma: Object,
});

console.log('[ props.ma ]-9', props.ma);

const changeCar = () => {
  console.log('[ props.car ]-10', props.car);
  props.car = '特斯拉~~';
  console.log('[ props.car ]-12', props.car);
};

const changeMaName = () => {
  props.ma.name = 'ls';
};

const addMoney = () => {
  props.money++;
};
</script>

<template>
  <div>我是子组件</div>
  <div>money1: {{ money }}<button @click="addMoney">我要赚钱</button></div>
  <div>money2: {{ money }}<button @click="money++">我要赚钱</button></div>
  <div>car: {{ car }}，<button @click="changeCar">我要换车</button></div>
  <div>
    ma: {{ ma }}，<button @click="changeMaName">我要给后妈改名字</button>
  </div>
</template>
